<template>
    <p>获取</p>
    <!-- <p>{{ all.a1 }}</p>
    <p>{{ all.a2 }}</p> -->
    <button @click="clickAll">点击</button>
    <p v-for="person in p1">{{ person.name }}</p>
</template>

<script lang="ts">
export default {
    name: 'Hello'
}
</script>

<!--setup语法糖-->
<script setup lang="ts">
//引入
import type { Person,Ps } from '@/type';
import { ref, defineExpose, defineProps } from 'vue' 

//defineProps只能调用一次，不能重复调用
//接受值
// let all = defineProps(['a1', 'a2'])
//接受值 限制
// defineProps<{p1?:Ps}>()
withDefaults(defineProps<{ p1?: Ps }>(), {
    p1: () => [{ id: 1,name:'ww',age:50}]
})

function clickAll() { 
    // console.log(all);
}

</script>